package com.stu.day11.factory3.f1;

import com.stu.day11.factory3.*;

/**
 * @author zy
 * @date 2025/2/3 21:54
 */
public class Test {
    public static void main(String[] args) {
        // 创建豪华车工厂
        CarFactory luxuryFactory = new LuxuryCarFactory();
        CarBody luxuryBody = luxuryFactory.createCarBody();
        Seat luxurySeat = luxuryFactory.createSeat();
        Wheel luxuryWheel = luxuryFactory.createWheel();

        luxuryBody.bodyAssemble();
        luxurySeat.seatAssemble();
        luxuryWheel.wheelAssemble();

        System.out.println("-----------------------------------");

        // 创建经济车工厂
        CarFactory economyFactory = new EconomyCarFactory();
        CarBody economyBody = economyFactory.createCarBody();
        Seat economySeat = economyFactory.createSeat();
        Wheel economyWheel = economyFactory.createWheel();

        economyBody.bodyAssemble();
        economySeat.seatAssemble();
        economyWheel.wheelAssemble();
    }
}
